package com.gitee.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gitee.bo.OrderBo;
import com.gitee.enums.OrderStatusEnum;
import com.gitee.pojo.Order;
import com.gitee.vo.OrderVo;
import com.gitee.vo.PageVo;

public interface IOrderService extends IService<Order> {

    /**
     * 订单查询
     * @param cookbookType
     * @param orderStatus
     * @param orderType
     * @param userId
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageVo<OrderVo> pageOrderVos(Integer cookbookType, Integer orderStatus, Integer orderType,
                                 Integer userId, Integer pageNum, Integer pageSize);


    /**
     * 查询单个订单
     * @param userId
     * @param orderId
     * @return
     */
    OrderVo getOrderVo(Integer userId, Integer orderId);
    /**
     * 取消订单
     * @param orderId
     * @param userId
     * @return
     */
    Boolean cancelOrder(Integer orderId, Integer userId);

    /**
     * 删除订单
     * @param orderId
     * @param userId
     * @return
     */
    Boolean deleteOrder(Integer orderId, Integer userId);

    /**
     * 创建订单
     * @param userId
     * @param orderBo
     * @return
     */
    Boolean createOrder(Integer userId, OrderBo orderBo);

    /**
     * 修改订单状态
     * @param orderStatus
     * @return
     */
    Boolean updateOrderStatus(Integer orderId, OrderStatusEnum orderStatus);
}
